<?php
$current_object = get_queried_object();
$active_option = get_option('azio_style_option', 'option_not_set');
get_header(); ?>
    <div id="main-container" class="<?php echo $active_option->main_container; ?>">
        <div class="page-top-leader omega<?php echo ' '.$active_option->page_top_leader; ?>">
            <div class="container_12 relatived clearfix">
                <h1 class="page-title"><?php echo $current_object->name ?></h1>
                <?php
                if (function_exists('yoast_breadcrumb')) {
                    yoast_breadcrumb('<div class="breadcrumb">', '</div>');
                }
                ?>
            </div>
        </div>
        <!-- .page-top-leader -->
        <div class="container_12">
            <?php get_sidebar('product') ?>
            <!-- end #column-left -->

            <div class="aside-container grid_9 omega">
                <div class="blog-listing clearfix">
                    <?php while (have_posts()): the_post(); ?>
                        <?php
                        $image_large = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'large');
                        $permalink = get_permalink();
                        $title = get_the_title();
                        $content = get_the_content();
                        ?>
                        <article class="grid_9 omega">
                            <div class="grid_5">
                                <div class="meta">
                                    <span class="date"><span class="day"><?php echo get_the_time('d') ?></span><span class="month"><?php echo get_the_time('m') ?></span></span>

                                    <div class="title">
                                        <h4><?php echo Azio_Posts::cut_tring_by_char($title, 50); ?></h4>
                                        <?php
                                        $term_list_name = wp_get_post_terms(get_the_ID(), 'category', array("fields" => "names"));
                                        foreach ($term_list_name as $term_name) {
                                            echo '<span>' . $term_name . '</span>';
                                        }
                                        ?>
                                    </div>
                                </div>
                                <a class="img-cover" href="<?php echo $permalink ?>"><img src="<?php echo $image_large[0] ?>" alt="news-image">
                                </a></div>
                            <div class="grid_4 omega">
                                <div class="excerpt">
                                    <p><?php echo Azio_Posts::cut_tring_by_char(strip_tags($content), 430) ?></p>
                                </div>
                                <a class="blog-link" href="<?php echo $permalink ?>"><i class="icomoon" aria-hidden="true" data-icon="&#xe01a;"></i>Xem tiếp</a>
                            </div>
                        </article>
                    <?php endwhile; ?>

                </div>
                <!-- .blog-listing -->
                <div class="grid_9 omega">
                    <?php if (function_exists('wp_pagenavi')) wp_pagenavi(); ?>
                    <!-- / Paging-->
                </div>
            </div>
            <!-- end .aside-container -->
        </div>
        <!-- end .container_12 -->

        <?php get_template_part('block', 'baseinfo') ?>
        <!-- end .base-info -->
    </div>
    <!-- end #main-container -->

<?php get_footer(); ?>